﻿<%@ Page Title="" Language="C#" MasterPageFile="~/store/StoreMasterPage.master" AutoEventWireup="true" CodeBehind="store_view.aspx.cs" Inherits="Com.Web.coffinegurunaru.store.store_view" %>
<%@ Import Namespace="Com.Library.DB.Store" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
<SCRIPT type="text/javascript" src="http://openapi.map.naver.com/js/naverMap.naver?key=<%=NaverAPI.GetAPIKey()%>"></SCRIPT>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">



		 <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="33">&nbsp;</td>
          </tr>
          <tr>
            <td><img src="/images/store/tit_02.gif" width="394" height="48"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><img src="/images/store/outstore_img.gif" width="769" height="85"></td>
          </tr>
          <tr>
            <td><table width="769" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="28" valign="top"><img src="/images/store/store_left.gif" width="28" height="361"></td>
                <td valign="top"><!--지점 상세내용 -->
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="center"><table width="150" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="40" class="dark_gray"><%=StoreInfo.StoreName%></td>
                      </tr>
                      <tr>
                        <td bgcolor="#e8e8e8"><img src="/images/common/clear.gif" width="1" height="1"></td>
                      </tr>
                      <tr>
                        <td style="padding-top:6px"><strong><span class="gray"><%=StoreInfo.Address%></span></strong><br>
                          <span class="gray_sbold">Tel. <%=StoreInfo.Phone%><br>
                          <%=StoreInfo.OpenTime%></span></td>
                      </tr>
<% if ( StoreInfo.IsParking == "1" ) { %>
                      <tr>
                        <td height="30"><img src="/images/store/icon_valet.gif" width="81" height="14"></td>
                      </tr>
<% } else if ( StoreInfo.IsParking == "3" ) { %>
                      <tr>
                        <td><%=StoreInfo.Parking %></td>
                      </tr>
<% } else { %>
						<tr>
                        <td>&nbsp;</td>
                      </tr>
<% } %>
                      <tr>
                        <td height="155" valign="top"><table border="0" cellspacing="0" cellpadding="5" bgcolor="#c5c5c5">
                          <tr>
                              <td><div id="m_SmallMapContainer" style="width:138px; height:138px;"></div></td>
                            </tr>
                        </table>
<script language="JavaScript" type="text/javascript">
<!--
	/*지도 개체 생성 */
	var opts1 = {width:138, height:138, mapMode:0};
	var mapObj1 = new NMap(document.getElementById('m_SmallMapContainer'),opts1);
	var point1 = new NPoint(<%=StoreInfo.PointX %>,<%=StoreInfo.PointY %>);
	
	mapObj1.setCenterAndZoom(point1, 3);
//-->
</script>
                        </td>
                      </tr>
                      <tr>
                        <td align="right" style="padding-right:3px"><a href="#" onclick="$.NewStore.Print(); return false;"><img src="/images/store/bt_print.gif" width="21" height="20"></a></td>
                      </tr>
                    </table></td>
                    <td width="27"><img src="/images/store/bar.gif" width="12" height="291"></td>
                    <td width="400"><img src="<%=StoreImageList.Count == 0 ? "/images/store/img_b.jpg" : StoreImageList[0].ImageURL%>" width="387" height="290" id="m_ViewImage"></td>
                    <td width="98"><table width="100%" border="0" cellspacing="0" cellpadding="0" id="m_StoreImageList">
<% foreach(StoreImageEntity item in StoreImageList ) { %>
                      <tr>
                        <td height="60" class="m_StoreImage"><a href="#" onmouseover="$('#m_ViewImage').attr('src', $(this).find('img').attr('src'))" onclick="return false;"><img src="<%=item.ImageURL %>" width="67" height="50"></a></td>
                      </tr>
<% } %>
<% for ( int i = StoreImageList.Count; i < 5; i ++ ) { %>
					   <tr>
                        <td height="60">&nbsp;</td>
                      </tr>
<% } %>
                    </table></td>
                  </tr>
                </table>
                  <!--지점 상세내용 끝 -->
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td align="center"><!--큰 지도 -->
                      <div id='m_MapContainer' style='width:645px;height:370px; background-color:#c5c5c5'></div>
                        <!--큰 지도 끝 -->
<script language="JavaScript" type="text/javascript">
<!--
	/*지도 개체 생성 */
	var opts = {width:645, height:370, mapMode:0};
	var mapObj = new NMap(document.getElementById('m_MapContainer'),opts);

	/* 지도 좌표, 축적 수 준 초기화 */
	var iconURL = "/images/coffine.jpg";
	var iconSize = new NSize(30, 30);
	var icon = new NIcon(iconURL, iconSize)
	var point = new NPoint(<%=StoreInfo.PointX %>,<%=StoreInfo.PointY %>);
	
	mapObj.setCenterAndZoom(point ,2);

	/* 지도 컨트롤 생성 */
	var zoom = new NZoomControl();

	zoom.setAlign("left"); zoom.setValign("top");
	mapObj.addControl(zoom);

	/* 지도 모드 변경 버튼 생성 */
	var mapBtns = new NMapBtns();
	mapBtns.setAlign("right"); mapBtns.setValign("top");
	mapObj.addControl(mapBtns);
	
	// 아이콘 표시 //	
	var markObj = new NMark(point, icon);
	mapObj.addOverlay( markObj );
	
	var infowin = new NInfoWindow();
	mapObj.addOverlay(infowin);
	NEvent.addListener(markObj, "mouseover", function(pos) {
			infowin.set(pos, '<div style="width:100px; height:50px; background-color:#ffffff; border:solid 1px #666666;"><%=StoreInfo.Address %></div>');
			infowin.showWindow()
	});
	NEvent.addListener(markObj, "mouseout", function() {
			infowin.hideWindow();
	});
//-->
</script>


                        </td>
                    </tr>
                </table></td>
                <td width="30" valign="top"><img src="/images/store/store_right.gif" width="30" height="361"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="30">&nbsp;</td>
          </tr>
          <tr>
            <td height="10" align="center"><table width="90%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td background="/images/common/gray_dot.gif"><img src="/images/common/gray_dot.gif" width="3" height="1"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="center"><!--다른지점 --><br />
              <table width="90%" border="0" cellspacing="0" cellpadding="0" id="m_StoreList">
              <tr>
                <td width="40" align="center"><a href="#" class="m_LeftMove"><img src="/images/store/bt_arrow1.gif" width="20" height="25"></a></td>
<% foreach(StoreEntity item in StoreList ) { %>
                <td class="m_StoreInfo" style="display:none;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="center"><a href="/store/store_view.aspx?storeno=<%=item.StoreNo %>"><img src="<%=item.GetImageURL() %>" width="110" height="83"></a></td>
                    </tr>
                  <tr>
                    <td height="20" align="center"><a href="/store/store_view.aspx?storeno=<%=item.StoreNo %>"><%=item.StoreName %></a></td>
                    </tr>
                  </table></td>
<% } %>
<% if ( StoreList.Count % 5 != 0 ) { %>
<%		for ( int i = (StoreList.Count % 5); i <5 ; i ++ ) { %>
				<td class="m_StoreInfo" style="display:none;"><table border="0" cellspacing="0" cellpadding="0" width="100">
                  <tr>
                    <td align="center">&nbsp;</td>
                    </tr>
                  <tr>
                    <td height="20" align="center"></td>
                    </tr>
                  </table></td>
<%		} %>
<% } %>
                <td width="40" align="center"><a href="#" class="m_RightMove"><img src="/images/store/bt_arrow2.gif" width="20" height="25"></a></td>
                </tr>
              </table>
            </td>
          </tr>
          </table>
<script language="javascript" type="text/javascript">
(function($) {
	$.NewStore = {};
	
	$.NewStore = {
		PageNo : 1,
		Init : function() {
			$.NewStore.ListView();
			$("#m_StoreList a.m_LeftMove").click(function() {
				$.NewStore.LeftMove();
				return false;
			});
			
			$("#m_StoreList a.m_RightMove").click(function() {
				$.NewStore.RightMove();
				return false;
			});
		},
		
		Print : function() {
			var win = window.open( "about:blank","prt","width=600, height=600, status=yes, scrollbars=yes");
			win.document.open();
			win.document.write( $("#m_MapContainer").html() );
			win.document.close();
			win.print();
			win.close(); 
		},
		
		LeftMove : function() {
			if ( $.NewStore.PageNo <= 1 )
				return;
			$.NewStore.PageNo--;
			
			$.NewStore.ListView();
		},
		
		RightMove : function() {
			if ( $.NewStore.PageNo >= ( $("#m_StoreList td.m_StoreInfo").size() / 5 ) )
				return;
			$.NewStore.PageNo++;
			
			$.NewStore.ListView();
		},
		
		ListView : function()
		{
			var startNo = ( ( $.NewStore.PageNo - 1 ) * 5 ) ;
			$("#m_StoreList td.m_StoreInfo").hide();
			for(var i = startNo; i< startNo + 5; i ++ )
			{
				$("#m_StoreList td.m_StoreInfo:eq(" + i + ")").show();
			}
		}
	}
	
	$(function() {
		$.NewStore.Init();
	});
})(jQuery);
</script>








</asp:Content>
